#pragma once

#include <iostream>
#include <string>

namespace lurpc {

class Int32 {
public:
    Int32(int32_t _v) : _x(_v) { }
private:
    int32_t _x;

public:
    std::string to_json() {
        return std::to_string(_x);
    }
    void parse_json(const char* _buf) {
        _x = std::stoi(_buf);
    }
};

class Int64 {
public:
    Int64(int64_t _v) : _x(_v) { }
private:
    int64_t _x;

public:
    std::string to_json() {
        return std::to_string(_x);
    }
    void parse_json(const char* _buf) {
        _x = std::stoll(_buf);
    }
};

class UInt32 {
public:
    UInt32(uint32_t _v) : _x(_v) { }
private:
    uint32_t _x;

public:
    std::string to_json() {
        return std::to_string(_x);
    }
    void parse_json(const char* _buf) {
        _x = std::stoi(_buf);
    }
};

class UInt64 {
public:
    UInt64(uint64_t _v) : _x(_v) { }
private:
    uint64_t _x;

public:
    std::string to_json() {
        return std::to_string(_x);
    }
    void parse_json(const char* _buf) {
        _x = std::stoll(_buf);
    }
};

class Float {
public:
    Float(float_t _v) : _x(_v) { }
private:
    float_t _x;

public:
    std::string to_json() {
        return std::to_string(_x);
    }
    void parse_json(const char* _buf) {
        _x = std::stof(_buf);
    }
};

class Double {
public:
    Double(double_t _v) : _x(_v) { }
private:
    double_t _x;

public:
    std::string to_json() {
        return std::to_string(_x);
    }
    void parse_json(const char* _buf) {
        _x = std::stod(_buf);
    }
};

class Char {
public:
    Char(char _v) : _x(_v) { }
private:
    char _x;

public:
    std::string to_json() {
        return std::to_string(_x);
    }
    void parse_json(const char* _buf) {
        _x = *_buf;
    }
};


}

